<!--
 * @Description: 面包屑组件
 * @Author: zhihong deng
 * @Date: 2021-09-08 23:42:23
 * @LastEditors: zhihong deng
 * @LastEditTime: 2021-09-11 16:38:35
-->
<template>
  <div>
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item v-for="(item,index) in breadList" :key="item.path">
        <router-link to="/welcome" v-if="index == 0">{{ item.meta.title }}</router-link>
        <span v-else>{{ item.meta.title }}</span>
      </el-breadcrumb-item>
    </el-breadcrumb>
  </div>
</template>

<script>
export default {
  name: 'BreadCrumb',
  // 计算（获取）面包屑的层级
  computed: {
    breadList() {
      return this.$route.matched;
    }
  }
}
</script>

<style>

</style>